package com.gogowan.agroenterprise.newview;

import java.util.ArrayList;
import java.util.List;

import com.gogowan.agroenterprise.R;
import com.gogowan.agroenterprise.base.BaseActivity;
import com.gogowan.agroenterprise.model.BoxCode;
import com.gogowan.agroenterprise.model.BoxCodeMaterial;
import com.gogowan.agroenterprise.widget.adapter.InOutDetailAdapter;

import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.Window;
import android.widget.ImageButton;
import android.widget.ListView;

public class NewInOutDetailActivity extends BaseActivity {

	private ListView lv;
	private InOutDetailAdapter InOutDetailAdapter;
	private List<BoxCodeMaterial> datas = new ArrayList<>();
	private BoxCode boxCode;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		requestWindowFeature(Window.FEATURE_NO_TITLE);
		setContentView(R.layout.new_activity_inout_details);
		
		ImageButton fhBtn = (ImageButton) findViewById(R.id.in_storage_fh_btn);
		fhBtn.setOnClickListener(new OnClickListener() {
			
			@Override
			public void onClick(View v) {
				finish();
			}
		});
		
		boxCode = (BoxCode) getIntent().getSerializableExtra("item");
		if (boxCode != null && boxCode.getBoxMaterial().size() > 0) {
			datas.addAll(boxCode.getBoxMaterial());
		}

		lv = (ListView) findViewById(R.id.inoutlist);
		InOutDetailAdapter = new InOutDetailAdapter(this, datas);
		lv.setAdapter(InOutDetailAdapter);
	}
}
